<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
 </head>
 <body>
为抵抗洪水，战士连续作战89小时，编程计算共多少天零多少小时？

<br>3天7小时
<br>
<input type="text" id="num1"/>
<input type="text"  id="num2"/>
<input type="button" value="计算" onclick="a()"/>

<script>
	function a(){
	var time=num1.value;
	var hour=num2.value;

	 time=parseInt(time);
	 hour=parseInt(hour);
		var c=time/hour
		c=c.toFixed(1)
	 document.write(c);

	}
  
  </script>

 </body>
  
</html>
